package com.zzx.boot.controller;

import com.zzx.boot.exception.SystemctlException;
import com.zzx.boot.utils.R;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author tan
 * @version 1.0
 * @date 2023/7/8 23:37
 */
@RestController
@RequestMapping("/zzx")
public class SystemErrorController {

    @RequestMapping("/error")
    public R error(HttpServletRequest request){
        SystemctlException e = (SystemctlException) request.getAttribute("err");
        throw e;
//        return R.error(123,"123");
    }
}
